home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / August 96 / Re Undo Set Property.7 < prev    next >
Encoding:
Internet Message Format  |  1996-08-08  |  1.8 KB  |  [TEXT/ttxt]

  1. Subject:     Re:Undo Set Property
  2. Sent:        8/7/96 7:18 PM
  3. Received:    8/8/96 8:57 AM
  4. From:        Greg Friedman, friedman@cognosis.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Serge Froment wrote:
  9. > I've thought more about my part design and I am currently considering
  10. > changing my Apple Events so my properties are independent of each other. In
  11. > that case, the current implementation of FW_CSetPropertyCommand will suit
  12. > my needs.
  13.  
  14. Either way, I think it should work.
  15.  
  16. > The main problem I have is that some of my properties are related to each
  17. > other. When I set them independantly, the part data as a whole may become
  18. > invalid. What I do now is adjusting other properties so the part data is
  19. > always valid.
  20. >
  21. > Is it possible to set several properties of a part with a single Apple Event?
  22.  
  23. It is, but I suggest you don't force your users to do it. FW_MScriptable
  24. has a method called SetProperties. This method should get called when users
  25. send a create event, and include property data for the new element. You can
  26. see this at work in ODFDraw for events like:
  27.  
  28. make new shape with {color : red, location : {0, 0}}
  29.  
  30. You might also decide to support a "properties" property to implement
  31. similar functionality for setting groups of properties of existing objects.
  32. For example:
  33.  
  34. set properties of shape 1 to {color : red, location : {0, 0}}
  35.  
  36. I'll put this functionality into ODFDraw Release 2 so you can see how it
  37. works.
  38.  
  39. > In the case I keep my current Apple Event design, a
  40. > FW_MScriptable::SaveProperty method can solve my problem, but then I also
  41. > need a RestoreProperty method to be called when undoing.
  42.  
  43. RestoreProperty is already there.
  44.  
  45. Greg.
  46.  
  47.  
  48. ___________________________________________________________
  49.  Greg Friedman       ODF Engineering        Apple Computer
  50.  
  51.  
  52.